-- manual_cure
-- created by zhuangsl
-- 根据工程学手册成长的治疗

return {
    -- 学习技能
    apply = function(id, info)
        if type(info) ~= "table" then
            return;
        end

        local num = FormulaM.invoke("CALC_MANUAL_CURE", info);
        BonusM.doBonus({2, info["attrib"], num}, "engineering_manual_bonus");
    end,

    -- 检查技能能否升级
    check = function(id)
        return true;
    end,

    -- 二级界面描述
    desc = function(id, info)
        local temp = getLocStr("engineering_manual_attrib_desc");

        local attribName = FieldsM.getFieldName(info["attrib"]);
        local curValue = ME.user:queryAttrib(info["attrib"]);
        local maxValue = ME.user:queryAttrib("max_" .. info["attrib"]);

        return string.format(temp, attribName, curValue, maxValue) .. "\n";
    end,
};
